set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
    "QuarkslaB Dynamic binary Instrumentation")
set(CPACK_PACKAGE_VENDOR "Quarkslab")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "QBDI Team <qbdi@quarslab.com>")
set(CPACK_PACKAGE_VERSION_MAJOR "${QBDI_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${QBDI_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${QBDI_VERSION_PATCH}")
if(QBDI_PTRAUTH)
  set(CPACK_SYSTEM_NAME ${QBDI_PLATFORM}-${QBDI_ARCH}-arm64e)
else()
  set(CPACK_SYSTEM_NAME ${QBDI_PLATFORM}-${QBDI_ARCH})
endif()
set(CPACK_PACKAGE_FILE_NAME "QBDI-${QBDI_VERSION_STRING}-${CPACK_SYSTEM_NAME}")
if(QBDI_PLATFORM_WINDOWS)
  if(QBDI_ARCH_X86_64)
    set(CPACK_GENERATOR "NSIS64")
  else()
    set(CPACK_GENERATOR "NSIS")
  endif()
  set(CPACK_NSIS_PACKAGE_NAME "QBDI ${QBDI_VERSION_STRING} (${QBDI_ARCH})")
elseif(QBDI_PLATFORM_OSX)
  set(CPACK_GENERATOR "productbuild")
else()
  set(CPACK_GENERATOR "TGZ")
endif()

if(FULL_PACKAGE)
  set(CPACK_SET_DESTDIR true)
  set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
  set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "./")
  set(CPACK_COMPONENTS_ALL "QBDI;QBDITemplate;QBDIFridaTemplate")
else()
  set(CPACK_COMPONENTS_ALL "QBDI")
endif()
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/Welcome.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/Readme.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt")

include(CPack)
